package edu.bu.cs673.superkids123.children.controller.lessons;


import java.util.List;

import edu.bu.cs673.superkids123.AbstractController;
import edu.bu.cs673.superkids123.AbstractFrame;

import edu.bu.cs673.superkids123.children.DataObjectAccess.ReportManager;
import edu.bu.cs673.superkids123.children.controller.AchievementController;
import edu.bu.cs673.superkids123.children.model.CompletedLesson;
import edu.bu.cs673.superkids123.children.view.ActivitiesMenuView;
import edu.bu.cs673.superkids123.children.view.lessons.LessonResultsView;
import edu.bu.cs673.superkids123.common.model.Achievement;
import edu.bu.cs673.superkids123.parents.view.ParentSettingsView;

//LessonResultsController provides use of returnToMenuButton & parentsButton

public class LessonResultsController extends AbstractController {

	private List<Achievement> earnedAchievements;

	public LessonResultsController(AbstractFrame mainFrame) {
		super(mainFrame);
	}

	public void returnToMenuButtonPressed() {
		getMainFrame().changeView(ActivitiesMenuView.class);
	}
	
	public void parentsButtonPressed() {
		getMainFrame().changeView(ParentSettingsView.class);
	}
	
	/**
	 * After a lesson has been completed, takes the passed completed lesson
	 * saves it to the database then shows the result screen.
	 * 
	 * @param completedLesson
	 */
	public void showResultScreen(List<Achievement> earnedAchievements) {
		
		this.earnedAchievements = earnedAchievements;
		getMainFrame().changeView(LessonResultsView.class);
	}
	
	// Setters & Getters
	
	public List<Achievement> getEarnedAchievements() {
		return earnedAchievements;
	}
}
